import { Base } from '../../../utils/base.js';
class HomeIndex extends Base {
  constructor() {
    super();
  }
  save_coupon(data, callback){
    var param = {
      url: 'weix/save_coupon',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }
  getOrder(data, callback) {  //订单
    var param = {
      url:'order/index',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  sendFormId(data, callback) {  //formId
    var param = {
      url: 'goods/take_number',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  linespeed(data, callback) {  //排队进度
    var param = {
      url: 'goods/line_speed',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }
  //微信支付
  wePayment(data, callback) {
    var param = {
      url: 'weix/pay',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  coupon(data, callback) {  //判断是否有优惠券
    var param = {
      url: 'order/coupon',
      type: "post",
      loading: 'hide',
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }
  
  pay(data,callback){            //支付
  var param = {
    url:'weix/pay',
    type:"post",
    data: data,
    sCallback: function (data) {
      callback && callback(data);
    }
  };
  this.request(param);
  }

};
export { HomeIndex };